# plugin 目录 CMakeLists.txt
# 收集所有源文件
file(GLOB_RECURSE PLUGIN_SOURCES "*.cpp")
file(GLOB_RECURSE PLUGIN_HEADERS "include/*.h" "include/*.hpp")

# 创建插件库 (共享库)
add_library(plugin_lib SHARED ${PLUGIN_SOURCES} ${PLUGIN_HEADERS})

# 设置包含目录
target_include_directories(plugin_lib
    PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)

# 链接所需的库
target_link_libraries(plugin_lib
    PUBLIC
    common_lib
    # Folly::folly
    ${Boost_LIBRARIES}
)

# 设置安装规则
install(TARGETS plugin_lib
    LIBRARY DESTINATION lib
)
install(DIRECTORY include/
    DESTINATION include/plugin
    FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
)

# 输出提示信息
message(STATUS "已配置 plugin 库")
